<?php

/*
 * 字体大小装饰器
 * 
 */

namespace IMooc;

class SizeDrawDecorator implements DrawDecorator {

    //将想要更改的字体大小保存到受保护的属性里
    protected $_size;

    //通过构造函数接收想要更改的字体大小
    function __construct($size = '14px')
    {
        $this->_size = $size;
    }

    function beforeDraw()
    {
        echo "<div style = 'font-size:{$this->_size};'>";
    }

    function afterDraw()
    {
        echo '</div>';
    }

}
